var express = require("express")
var app = express();
var path = require("path")


// 解决post 请求解析的配置
app.use(express.json());
app.use(express.urlencoded({ extended: false }));

// 配置静态资源路径
app.use(express.static(path.join(__dirname, "public")))
// 引入路由
var indexRouter = require("./routes/index");
// 使用路由
app.use("/user", indexRouter)


// 设置监听
app.listen("3000", "127.0.0.1", function () {
  console.log("启动服务器成功")
})